package com.ocom.exposeapi.feign;

import com.alibaba.fastjson.JSONObject;
import com.ocom.common.constant.PayConfigUrl;
import com.ocom.common.entity.card.EntityXfMerchPayInfo;
import com.ocom.common.request.exposeapi.LargeScreenRequest;
import com.ocom.common.request.exposeapi.boczhxy.AuthenticationRequest;
import com.ocom.common.request.payconfig.AddCardInfoVo;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.pay.ABCRechargeVo;
import com.ocom.common.vo.pay.UpdateListRechargeVo;
import com.ocom.common.vo.payconfig.UpdatecardStateVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;


@FeignClient(value = "payconfig")
public interface PayConfigClientService {

    @PostMapping(PayConfigUrl.Url_getPayInfo)
    public Result getPayInfo(@RequestBody EntityXfMerchPayInfo entityXfMerchPayInfo);

    @PostMapping(PayConfigUrl.URLP_getOnePersonInfo)
    public Result getPageChannel(@RequestParam("comId")Long comId,@RequestParam("pCode") String pCode,@RequestParam("pName") String pName);

    @PostMapping(PayConfigUrl.Url_abcRecharge)
    public Result abcRecharge(@RequestBody ABCRechargeVo updateListRechargeVo);


    // 查询卡信息（getCardInfo）
    @GetMapping(PayConfigUrl.Url_GetCardInfoByPid)
    public Result GetCardInfoByPid(@RequestParam("comId")Long comId,@RequestParam("pId") Long pId);

    @PostMapping(PayConfigUrl.Url_GetCardInfoByCardNo)
    public Result getCardInfoByCardNo(@RequestParam("comId")Long comId, @RequestParam("cardNo")String cardNo);

    @PostMapping(PayConfigUrl.Url_AddCardInfo)
    public Result AddCardInfo(@RequestBody AddCardInfoVo addCardInfoVo);

    @PostMapping(PayConfigUrl.Url_UpdatecardState)
    public Result UpdatecardState(@RequestBody UpdatecardStateVo updatecardStateVo);

    /**
     * 个人账户充值（updateListRecharge）
     * */
    @PostMapping(PayConfigUrl.Url_UpdateListRecharge)
    public Result UpdateListRecharge(@RequestBody UpdateListRechargeVo updateListRechargeVo);

    //2.1.获取餐段名称信息(getMealNameInfo)
    @GetMapping(PayConfigUrl.URLP_PayConfig_GetMealNameInfo)
    Result GetMealNameInfo(@RequestParam("comId") Long comId);

    //获取账号信息(getXFAccount)
    @GetMapping(PayConfigUrl.Url_GetXFAccount)
    public Result GetXFAccount(@RequestParam("comId")Long comId,@RequestParam("pId")Integer pId);

    //获取账号信息(getXFAccountByStatus)
    @GetMapping(PayConfigUrl.Url_GetXFAccountByStatus)
    public Result GetXFAccountByStatus(@RequestParam("comId")Long comId,@RequestParam("pId")Integer pId,@RequestParam("accountState") Integer accountState);


//    @PostMapping(PayHandleUrl.URL_InsertEntityXfRecord)
//    public Result InsertEntityXfRecord(@RequestBody EntiyEntiyXfRecordProcess entiyEntiyXfRecordProcess);

    //2.2.6 获取人员白名单最新版本（getXFWhiteVer）
    @PostMapping(PayConfigUrl.Url_getXFWhiteVer)
    public Result getXFWhiteVer(@RequestParam("comId")Long comId);

    @PostMapping(PayConfigUrl.Url_getDeviceInfo)
    public Result getDeviceInfo(@RequestParam("comId") Long comId, @RequestParam("machNo")String machNo);

    //初始化账号(addXFAccount)
    @PostMapping(PayConfigUrl.Url_AddXFAccount)
    public Result AddXFAccount(@RequestBody Map<String,Object> map);

    @PostMapping(PayConfigUrl.Url_UpdateXFAccount)
    public Result UpdateXFAccount(@RequestBody Map<String,Object> map);

    @PostMapping(PayConfigUrl.Url_updateConsMerchPayReports)
    public Result updateConsMerchPayReports(@RequestBody AuthenticationRequest request);

    @PostMapping(PayConfigUrl.Url_totalNumberPerson)
    public Result totalNumberPerson(@RequestBody LargeScreenRequest request);

    @PostMapping(PayConfigUrl.Url_yesterdayStudentMealRate)
    public Result yesterdayStudentMealRate(@RequestBody LargeScreenRequest request);


    @PostMapping(PayConfigUrl.URL_weimiCallBack)
    public String weimiCallBack(@RequestBody JSONObject jsonObject);;
}
